package com.design.pattern.behavior.template.general;

public abstract class AbstractClass {
    protected void step1(){
        System.out.println("step1");
    }
    protected void step2(){
        System.out.println("step2");
    }
    protected void step3(){
        System.out.println("step3");
    }

    /**
     * 声明为final方法，避免子类重写
     */
    public final void templateMethod(){
        this.step1();
        this.step2();
        this.step3();
    }
}
